home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #2 / Amiga Plus CD - 1995 - No. 2.iso / internet / faq / englisch / filteringmail < prev    next >
Encoding:
Text File  |  1995-04-11  |  28.6 KB  |  859 lines

  1. Archive-name: mail/filtering-faq
  2. Posting-frequency: approximately monthly
  3. Last-modified: 17 November 1994
  4.  
  5.  
  6.             _____________________________________________________
  7.   _________|                                                     |_________
  8.   \        |                                                     |        /
  9.    \       |                  FILTERING MAIL FAQ                 |       /
  10.     \      |                                                     |      /
  11.      \     |                                                     |     /
  12.      /     |           Copyright (c) 1994 Nancy McGough          |     \
  13.     /      |                                                     |      \
  14.    /       |_____________________________________________________|       \
  15.   /____________)                                              (___________\
  16.  
  17.  
  18.  
  19.   TABLE OF CONTENTS
  20.  
  21.    0.0 About this Article
  22.    ... 0.1 Copyright Notice
  23.    ... 0.2 Acknowledgements
  24.    ... 0.3 Terminology and Notation
  25.    ... 0.4 Getting the Latest Version of This Article
  26.    ... 0.5 Reading the Hypertext Version of This Article
  27.    ... 0.6 Reading the Plain Text Version of This Article
  28.    1.0 Naming Your Incoming Mail Folders
  29.    2.0 Procmail
  30.    ... 2.1 Setting Up Procmail
  31.    ... 2.2 Tracking Your Incoming Mail
  32.    ... 2.3 Explanation of Test Recipe
  33.    ... 2.4 Troubleshooting: Alternate .forward Files for Procmail
  34.    ... 2.5 Procmail References
  35.    3.0 Filter
  36.    ... 3.1 Setting up Filter
  37.    ... 3.2 Tracking Your Incoming Mail
  38.    ... 3.3 Filter References
  39.    4.0 Reading Incoming Mail Folders
  40.    5.0 Contributing to this FAQ
  41.  
  42. ----------------------------------------------------------------------
  43.  
  44. Date: 17 Nov 1994 23:00:00 GMT
  45. From: Nancy McGough <nancym@ii.com>
  46. Subject: 0.0 About this Article
  47.  
  48. Q: How can I have my incoming mail messages automatically put into an 
  49.    appropriate folder?
  50.  
  51. This is one of the most frequently asked questions about email.  This article 
  52. is the first release of an FAQ that addresses this question.  This version 
  53. gives basic instructions for how to set up either procmail or Elm's filter 
  54. to filter incoming mailing list messages.  Future versions of this FAQ will 
  55. include instructions for doing other things like automatically replying to 
  56. certain messages.
  57.  
  58. If your system has both procmail and filter installed then you should use 
  59. procmail which is *much* more robust and powerful than filter.  This 
  60. recommendation is almost universal; even the Elm and filter developers
  61. recommend procmail over filter.
  62.  
  63. ------------------------------
  64.  
  65. Date: 17 Nov 1994 23:00:10 GMT
  66. From: Nancy McGough <nancym@ii.com>
  67. Subject: ... 0.1 Copyright Notice
  68.  
  69. Copyright (c) 1994 by Nancy McGough.  No portion of this work may be sold or 
  70. put to commercial use without express written consent of the author.  This 
  71. restriction covers publication in any form, or distribution by any method, 
  72. which permits this work to be visually perceived, either directly or with the 
  73. aid of any machine or device. Permission is granted to republish or 
  74. redistribute this article in its entirety for noncommercial use if this 
  75. copyright notice is not removed or altered.
  76.  
  77. ------------------------------
  78.  
  79. Date: 17 Nov 1994 23:00:20 GMT
  80. From: Nancy McGough <nancym@ii.com>
  81. Subject: ... 0.2 Acknowledgements
  82.  
  83. Thanks to these people who sent suggestions:
  84.    David L. Miller <dlm@cac.washington.edu>
  85.    Cookie Monster <kmanley@bits.fc.hp.com>
  86.    Jim Showalter <gamma@mintaka.disa.mil>
  87.    David W. Tamkin <dattier@mcs.com>
  88.    Rick Troxel <rick@helix.nih.gov>
  89.    Stephen R. van den Berg <berg@pool.informatik.rwth-aachen.de>
  90.    Syd Weinstein <syd@dsinc.myxa.com>
  91.  
  92. Special thanks to:
  93.    Thomas A. Fine <fine@cis.ohio-state.edu> for setting up and
  94.    maintaining the hypertext archive of FAQs.  Congratulations
  95.    to him for winning O'Reilly and Associates' "The Best of the
  96.    Net" award!
  97.  
  98. Please let me know if I've left you, or anyone else, out of this list.
  99.  
  100. ------------------------------
  101.  
  102. Date: 17 Nov 1994 23:00:30 GMT
  103. From: Nancy McGough <nancym@ii.com>
  104. Subject: ... 0.3 Terminology and Notation
  105.  
  106.   Term    Meaning
  107.   ====    =======
  108.   FTP     File Transfer Protocol
  109.   HTML    HyperText Markup Language
  110.   HTTP    HyperText Transport Protocol
  111.   mailer  Mail user agent (MUA) such as Pine or Elm
  112.   pico    PIne COmposer - friendly editor that's part of the Pine package
  113.   RFC     Internet "Request For Comments" document
  114.   URL     Uniform Resource Locator (specified in RFC1630)
  115.   ^x      Press the Ctrl key and then, while holding down the Ctrl key, 
  116.           press the x key
  117.   ~       Your home directory $HOME  (see * below)
  118.  
  119. * In this article I use ~ (tilde) to mean your home directory.  Note that 
  120.   some shells, such as the Bourne shell (sh), do not understand the tilde 
  121.   notation so you will need to use $HOME instead.  You can always get to 
  122.   your home directory by typing ``cd''.
  123.  
  124. ------------------------------
  125.  
  126. Date: 17 Nov 1994 23:00:40 GMT
  127. From: Nancy McGough <nancym@ii.com>
  128. Subject: ... 0.4 Getting the Latest Version of This Article
  129.  
  130. If this article is over two months old then there is probably an updated
  131. version of it in all the usual archives.  Please get the latest version
  132. from one of these places:
  133.  
  134. World Wide Web (the nicest format for online reading!):
  135. http://www.cis.ohio-state.edu/hypertext/faq/usenet/mail/filtering-faq/faq.html
  136.  
  137. Anonymous FTP:
  138. ftp://rtfm.mit.edu/pub/usenet/news.answers/mail/filtering-faq
  139.  
  140. Email:
  141. Send mail to mail-server@rtfm.mit.edu containing the following:
  142.     send usenet/news.answers/mail/filtering-faq
  143.  
  144. UUCP:
  145. uunet!/archive/usenet/news.answers/mail/filtering-faq
  146.  
  147. ------------------------------
  148.  
  149. Date: 17 Nov 1994 23:00:50 GMT
  150. From: Nancy McGough <nancym@ii.com>
  151. Subject: ... 0.5 Reading the Hypertext Version of This Article
  152.  
  153. The best way to read this FAQ (and most other FAQs too) is to view the
  154. hypertext version using a Web browser such as Lynx, Mosaic, Netscape, 
  155. WinWeb, or Cello.  This will allow you to easily jump:
  156.    * between subjects in this article
  157.    * to a Uniform Resource Locator (URL)
  158.    * to an Internet Request For Comments document (RFC)
  159.    * to some manual pages
  160.  
  161. This, and all FAQs that are crossposted to news.answers, can be accessed 
  162. through:  http://www.cis.ohio-state.edu/hypertext/faq/usenet/top.html
  163.  
  164. This particular FAQ is at:
  165. http://www.cis.ohio-state.edu/hypertext/faq/usenet/mail/filtering-faq/faq.html
  166.  
  167. ------------------------------
  168.  
  169. Date: 17 Nov 1994 23:00:60 GMT
  170. From: Nancy McGough <nancym@ii.com>
  171. Subject: ... 0.6 Reading the Plain Text Version of This Article
  172.  
  173. If you are reading the plain text version (i.e., not the hypertext version) of 
  174. this FAQ it is in RFC1153 digest format which means each subject is formatted 
  175. as a mini mail message with its own Date, From, and Subject (and sometimes 
  176.  Followup-To) headers.  Some newsreaders and mailers make it really easy
  177. to jump to a subject in an article that is in digest format.  Here are 
  178. instruction for some newsreaders:
  179.  
  180. * NN's default is to split a digest and present each digest item on the 
  181.   menu.  If you have changed the default by putting ``set split off'' in 
  182.   your ~/.nn/init file then you can split an article that is in digest 
  183.   format by typing G% while viewing it.  This will present each digest item 
  184.   on a submenu.  You can then read, followup-to, save, print, etc. individual 
  185.   digest items.
  186.  
  187. * In trn (and its relatives like rn and strn) you can type ^g (Ctrl key 
  188.   and g key pressed together) to skip to the next line that begins with
  189.   "Subject: "
  190.  
  191. * In emacs GNUS, C-c C-n will skip to the next digest article (C-C C-p will
  192.   go back to the previous digest article).
  193.  
  194.  
  195. If your newsreader or mailer does not have a built-in command that allows
  196. you to easily read a digest you can pipe the article to ``formail -ds''
  197. which will split the article into separate mail messages, and then you can
  198. use your mailer or newsreader (if it can read mail folders) to read the
  199. folder.  For example, here's what you would do in Tin while viewing
  200. the article:
  201.  
  202. Type...                           In order to...
  203. -------                           --------------
  204. |                                 Pipe
  205. a                                 Specify the article is to be piped
  206. formail -ds >> ~/mail/faq.split   Split the digest into individual
  207.                                   messages and put them in a file named
  208.                                   ~/mail/faq.split.  (Replace ~/mail
  209.                                   with your folder directory.)
  210. pine -if faq.split                Use Pine to read the newly created folder.
  211.  
  212. For more information see the formail(1) man pages.
  213.  
  214. ------------------------------
  215.  
  216. Date: 17 Nov 1994 23:01:00 GMT
  217. From: Nancy McGough <nancym@ii.com>
  218. Subject: 1.0 Naming Your Incoming Mail Folders
  219.  
  220. For my incoming mail folders I use names that start with ``IN''.
  221. For example, I put mail sent to the procmail mailing list into a
  222. folder named IN.procmail.  I do this so that when all my folders
  223. are listed alphabetically the incoming folders are together and
  224. near the top.  They are near the top because Unix is case sensitive
  225. and upper case letters come before lower case letters in an ascii
  226. sort.
  227.  
  228. Of course, you can use any names you like for your mail folders.
  229.  
  230. ------------------------------
  231.  
  232. Date: 17 Nov 1994 23:02:00 GMT
  233. From: Nancy McGough <nancym@ii.com>
  234. Subject: 2.0 Procmail
  235.  
  236. Procmail is a powerful mail processor that can be used to process your
  237. mail messages either as they arrive or after they are in a mail folder.  
  238. This version of the FAQ describes the basics of setting up procmail to
  239. filter incoming mailing list messages.
  240.  
  241. To find out how to process existing mail folders see the NOTES section
  242. of the procmail(1) man page.
  243.  
  244. ------------------------------
  245.  
  246. Date: 17 Nov 1994 23:02:10 GMT
  247. From: Nancy McGough <nancym@ii.com>
  248. Subject: ... 2.1 Setting Up Procmail
  249.  
  250. 1] Find out if procmail is on your system and what the full path to it is.  
  251.    If you are using csh type:
  252.  
  253.      which procmail
  254.  
  255.    Or if you are using sh or ksh type:
  256.  
  257.      type procmail
  258.  
  259.    If neither ``which'' nor ``type'' are on your system try ``whereis'' and
  260.    ``where''.  If your system doesn't have procmail ask your system 
  261.    administrator to install it.  If your sys admin isn't able to do this,
  262.    use a different mail processor like deliver, mailagent, or filter 
  263.    (described in part 2 of this FAQ).
  264.  
  265.  
  266. 2a] Create ~/.procmailrc.  (Note that throughout this article I use
  267.     pico for editing files.  Replace ``pico'' with your editor.)
  268.  
  269.      cd
  270.      pico .procmailrc
  271.  
  272.   
  273. 2b] Enter a modified version of the following in your ~/.procmailrc.
  274.     Note that lines that begin with # are comments and are ignored by
  275.     procmail.
  276.  
  277.      #Set on when debugging
  278.      VERBOSE=off
  279.  
  280.      #Replace ``mail'' with your mail directory (Pine uses mail, Elm uses Mail)
  281.      MAILDIR=$HOME/mail
  282.      
  283.      #Directory for storing procmail log and rc files
  284.      PMDIR=$HOME/.procmail
  285.      
  286.      LOGFILE=$PMDIR/log
  287.      INCLUDERC=$PMDIR/rc.test
  288.      INCLUDERC=$PMDIR/rc.folders
  289.  
  290. 3] Create the directory where you will store your procmail log and rc files 
  291.    (this is $PMDIR that you set above).
  292.  
  293.      cd
  294.      mkdir .procmail
  295.  
  296.  
  297. 4a] Create an rc (run commands) file for testing:
  298.  
  299.      cd
  300.      cd .procmail
  301.      pico rc.test
  302.  
  303.  
  304. 4b] Enter the following in ~/.procmail/rc.test:
  305.  
  306.       :0:
  307.       * ^Subject: .*test
  308.       IN.testing
  309.  
  310.     Note that the first line contains a zero (0), not the letter "oh".
  311.     For now, don't worry about the meaning of this recipe.  It is
  312.     explained in the subject "Explanation of Test Recipe" below.
  313.  
  314.  
  315. 5a] Create a ~/.forward file by typing the following. (Pico's -w flag tells 
  316.     pico not to auto wrap lines.)
  317.  
  318.      cd
  319.      pico -w .forward
  320.  
  321.  
  322.  
  323. 5b] Enter a modified version of the following in your ~/.forward:
  324.  
  325.  
  326.      "|IFS=' ' && exec /usr/local/bin/procmail -f- || exit 75 #nancym"
  327.  
  328.  
  329.     == IMPORTANT NOTES ==
  330.     * Make sure you include all the quotes, both double (") and single (').
  331.     * The vertical bar (|) is a pipe.
  332.     * Replace /usr/local/bin with the correct path for procmail (see step 1).
  333.     * Replace ``nancym'' with your userid.  You need to put your userid in 
  334.       your .forward so that it will be different than any other .forward file 
  335.       on your system.
  336.    
  337.     * Do NOT use environment variables, like $HOME, in your .forward file.
  338.     * Do NOT expect ~ to mean your home directory in the .forward file: If 
  339.       procmail resides below your home directory write out the *full* path.
  340.  
  341.  
  342. 5c] Note that on many systems you need to make your .forward world 
  343.     readable and your home directory world searchable in order for the
  344.     mail transport agent to "see" it.  To do this type:
  345.    
  346.       cd
  347.       chmod 644 .forward
  348.       chmod a+x .
  349.  
  350.  
  351. 6] Send yourself two test messages: one with ``test'' in the subject
  352.    and one without ``test'' in the subject.
  353.  
  354.  
  355. 7a] Start your mailer (pine, elm, etc.) and check that the messages
  356.     were delivered correctly.  The one with ``test'' in the subject
  357.     should be in the folder $MAILDIR/IN.testing and the one without 
  358.     ``test'' in the subject should be in your inbox.  If these were
  359.     delivered correctly go on to step 8.
  360.  
  361.  
  362. 7b] TROUBLESHOOTING
  363.     * If the two messages were not delivered correctly look at your
  364.       $LOGFILE (~/.procmail/log) to see if you can determine what
  365.       the problem is.  
  366.  
  367.     * Check these three files for typos:
  368.         ~/.forward
  369.         ~/.procmailrc
  370.         ~/.procmail/rc.test
  371.  
  372.     * Check the file and directory permissions of your .forward (set in 
  373.       5c above).
  374.  
  375.       Type...          In order to...
  376.       -------          --------------
  377.       cd               Go to your home directory.
  378.       
  379.       ls -l .forward   Check the permission: it should say -rw-r--r--
  380.       
  381.       ls -ld .         Check permission of home dir: it should say drwx?-x?-x
  382.                        The ?'s may be r's or hyphens or one of each (i.e.,
  383.                        drwx--x--x, drwxr-xr-x, drwxr-x--x, drwx--xr-x).
  384.       
  385.  
  386.     * If none of these turn up the problem edit your ~/.procmailrc so
  387.       that it contains:
  388.  
  389.         VERBOSE=on
  390.  
  391.       And repeat steps 6 and 7.  If you are still having problems see the 
  392.       subject "Troubleshooting: Alternate .forward Files for Procmail" below.
  393.  
  394.    
  395. 8a] Once you have successfully tested procmail in steps 6 and 7, create 
  396.      rc.folders for filtering incoming messages into mail folders.
  397.   
  398.       cd
  399.       cd .procmail
  400.       pico rc.folders
  401.  
  402.  
  403. 8b] Enter a modified version of the following in ~/.procmail/rc.folders
  404.  
  405.      :0:
  406.      * ^TOwww-talk
  407.      IN.www-talk
  408.  
  409.      :0:
  410.      * ^TOprocmail
  411.      IN.procmail
  412.      
  413.      The first recipe filters the www-talk mailing list and the second recipe
  414.      filters the procmail mailing lists  The meaning of the first recipe is 
  415.      as follows:
  416.  
  417.      Notation      Meaning
  418.      ========      =======
  419.      :0            Begin a recipe
  420.        :           Use a lock file
  421.      *             Begin a condition 
  422.        ^TO         Match ``To:'' ``Cc:'' or other synonyms for To at the
  423.                    beginning of a line, followed by any or no characters,
  424.                    followed by....
  425.           www-talk  ``www-talk''
  426.      IN.www-talk   If successful match, put in folder $MAILDIR/IN.www-talk
  427.  
  428.   
  429.      Create a recipe for each of your mailing lists.  Make sure that you
  430.      use ``^TO'' with no space between the caret (^) and the word ``TO'', 
  431.      and that both letters are capitalized -- if you don't it won't work.
  432.  
  433.      Note that ^TO is not a normal regular expression.  It is a special
  434.      procmail expression that is designed to catch any destination 
  435.      specification.  See the MISCELLANEOUS section of the procmailrc(5)
  436.      man page for details.  For examples, see procmailex(5) man page.
  437.      
  438.  
  439. 9]  Repeat steps 6 and 7 to make sure that things are still working.
  440.  
  441.  
  442. 10]  Comment out the rc.test line in you .procmailrc file so that it looks 
  443.      like this:
  444.           
  445.        VERBOSE=off
  446.        MAILDIR=$HOME/mail
  447.        PMDIR=$HOME/.procmail
  448.        LOGFILE=$PMDIR/log
  449.        # INCLUDERC=$PMDIR/rc.test
  450.        INCLUDERC=$PMDIR/rc.folders
  451.  
  452.      Note that it's useful to leave the rc.test line there for future testing.
  453.  
  454. ------------------------------
  455.  
  456. Date: 17 Nov 1994 23:02:20 GMT
  457. From: Nancy McGough <nancym@ii.com>
  458. Subject: ... 2.2 Tracking Your Incoming Mail
  459.  
  460. There is a useful script, which is part of the procmail package, for 
  461. checking your procmail log file called mailstat.  Check to see if it is 
  462. on your system by typing either ``which mailstat'' or ``type mailstat''.  
  463. If it's on your system type:
  464.  
  465.   mailstat $HOME/.procmail/log
  466.  
  467. This displays a concise version of your log file and moves your log 
  468. file to log.old.  You may want to put the above line in your .login so that 
  469. each time you log in you will see a listing of how many messages you've
  470. received since the last time you ran mailstat, and what folders these
  471. messages were delivered to.
  472.  
  473. You can get a mailstat listing of log.old by using the -o flag:
  474.  
  475.   mailstat -o $HOME/.procmail/log
  476.  
  477.  
  478. If mailstat is not on your system ask your system administrator to
  479. install it.  It is located with all the other procmail tools at:
  480.  
  481. ftp://ftp.informatik.rwth-aachen.de/pub/packages/procmail/procmail.tar.gz
  482.  
  483. ------------------------------
  484.  
  485. Date: 17 Nov 1994 23:02:30 GMT
  486. From: Nancy McGough <nancym@ii.com>
  487. Subject: ... 2.3 Explanation of Test Recipe
  488.  
  489. The recipe we used for testing is:
  490.  
  491. :0:
  492. * ^Subject: .*test
  493. IN.testing
  494.  
  495.  
  496. The meaning of this recipe is:
  497.  
  498. Notation            Meaning
  499. ========            =======
  500. :0                  Begin a recipe
  501.   :                 Use a lock file
  502. *                   Begin a condition 
  503.   ^                 Match the beginning of a line followed by....
  504.    Subject:         ``Subject:'' followed by....
  505.             .       a space followed by any character (.) followed by....
  506.              *      0 or more of preceding character (any character in this 
  507.                        case) followed by....
  508.               test  ``test''
  509. IN.testing          If successful match, put in folder $MAILDIR/IN.testing
  510.  
  511. ------------------------------
  512.  
  513. Date: 17 Nov 1994 23:02:40 GMT
  514. From: "Stephen R. van den Berg" <berg@pool.informatik.rwth-aachen.de>
  515. Subject: ... 2.4 Troubleshooting: Alternate .forward Files for Procmail
  516.  
  517. If the .forward template in 5b above doesn't work the following alternatives 
  518. might be helpful:
  519.  
  520. In a perfect world:
  521.     "|exec /usr/local/bin/procmail #nancym"
  522. In an almost perfect world:
  523.     "|exec /usr/local/bin/procmail USER=nancym"
  524. In another world:
  525.     "|IFS=' ';exec /usr/local/bin/procmail #nancym"
  526. In a different world:
  527.     "|IFS=' ';exec /usr/local/bin/procmail USER=nancym"
  528. In a smrsh world:
  529.     "|/usr/local/bin/procmail #nancym"
  530.  
  531. These formats can be tried in different combinations, the leading "| can
  532. be tried as |" instead, or vice versa.
  533.  
  534. Some systems do not need a .forward file (i.e., having a .procmailrc file 
  535. suffices if procmail already is the local delivery agent).
  536.  
  537. ------------------------------
  538.  
  539. Date: 17 Nov 1994 23:02:50 GMT
  540. From: Nancy McGough <nancym@ii.com>
  541. Subject: ... 2.5 Procmail References
  542.  
  543. Manuals:   procmail(1)   - autonomous mail processor
  544.            procmailrc(5) - procmail rc file
  545.            procmailex(5) - procmail rc file examples
  546.            procmailsc(5) - procmail weighted scoring techique
  547.            egrep(1)      - search file for regular expression (procmail uses
  548.                            egrep-style regular exprssions along with some of 
  549.                            its own expressions like ^TO)
  550.            formail(1)    - mail reformatter
  551.            sendmail(8)   - send mail over the internet
  552. Newsgroup: comp.mail.misc
  553. Mailing List: procmail@informatik.rwth-aachen.de
  554.            Subscribe to the procmail mailing list by sending mail:
  555.              To: procmail-request@informatik.rwth-aachen.de 
  556.              Subject: subscribe
  557.  
  558. Procmail Archives:
  559.            Get a list of files available at the procmail mail server by 
  560.            sending mail:
  561.              To: procmail-request@informatik.rwth-aachen.de 
  562.              Subject: archive ls
  563.  
  564.            Get Best of the Procmail mailing list by sending mail (you'll 
  565.            need gzip and a MIME-decoder to unpack it):
  566.              To: procmail-request@informatik.rwth-aachen.de 
  567.              Subject: archive get best_of_procmail_list*
  568.  
  569. ------------------------------
  570.  
  571. Date: 17 Nov 1994 23:03:00 GMT
  572. From: Nancy McGough <nancym@ii.com>
  573. Subject: 3.0 Filter
  574.  
  575. Filter is part of the Elm package of tools.  Note that you can use filter
  576. to filter your incoming mail even if you are not using Elm to read your mail.
  577.  
  578. IMPORTANT NOTE
  579. ==============
  580. If your system has both procmail and filter installed then you should use 
  581. procmail which is *much* more robust and powerful than filter.  This 
  582. recommendation is almost universal; even the developers of Elm and Filter
  583. recommend procmail over filter.  IT IS POSSIBLE TO LOSE MAIL MESSAGES
  584. WHEN USING FILTER; this is rare but it has happened.
  585.  
  586. ------------------------------
  587.  
  588. Date: 17 Nov 1994 23:03:10 GMT
  589. From: Nancy McGough <nancym@ii.com>
  590. Subject: ... 3.1 Setting up Filter
  591. Followup-To: comp.mail.elm
  592.  
  593. 1] Find out if filter is on your system and what the full path to it is.  
  594.    If you are using the C shell (csh) type:
  595.  
  596.      which filter
  597.  
  598.    Or, if you are using the Korn shell (ksh) or the Bourne shell (sh) type:
  599.  
  600.      type filter
  601.  
  602.    If neither ``which'' nor ``type'' are on your system try ``where'' and
  603.    ``whereis''.  If your system doesn't have filter ask your system 
  604.    administrator to install it; or even better ask her to install procmail.
  605.  
  606.  
  607. 2] Note the full path of your home directory by typing:
  608.  
  609.      cd
  610.      pwd
  611.  
  612.  
  613. 3a] Create ~/.elm/filter-rules.  (Note that throughout this article I use
  614.     pico for editing files.  Replace ``pico'' with your editor.)
  615.  
  616.      cd
  617.      mkdir .elm
  618.      cd .elm
  619.      pico filter-rules
  620.  
  621.   
  622. 3b] Enter a modified version of the following in your ~/.elm/filter-rules
  623.  
  624.      if (subject contains "test") then save "/j/nancym/Mail/IN.testing"
  625.    
  626.    Replace /j/nancym with your home directory path (see step 2).
  627.    Replace /Mail with the name of the directory where your mail folders are
  628.    stored.  Pine and Berkeley Mail use /mail (lower case m) and Elm uses 
  629.    /Mail (upper case M).
  630.    
  631.  
  632. 4] To see what the filter rule will do type the following at your Unix 
  633.    prompt:  
  634.  
  635.      filter -r
  636.  
  637.  
  638. 5a] Create a ~/.forward file by typing the following. (Pico's -w flag tells 
  639.     pico not to auto wrap lines.)
  640.  
  641.       cd
  642.       pico -w .forward
  643.  
  644.  
  645. 5b] Enter a modified version of the following in your ~/.forward:
  646.  
  647.  
  648.      "|/usr/local/bin/filter -o /j/nancym/.elm/filter-errors"
  649.  
  650.  
  651.     == IMPORTANT NOTES ==
  652.     * Make sure you include the quotes (").
  653.     * The vertical bar (|) is a pipe.
  654.     * Replace /usr/local/bin with the correct path for filter (see step 1).
  655.     * Replace /j/nancym with your home directory (see step 2).
  656.    
  657.     * Do NOT expect environment variables, like $HOME, to work in your 
  658.       .forward file.
  659.     * Do NOT expect ~ to mean your home directory in the .forward file.
  660.  
  661.  
  662. 5c] Note that on many systems you need to make your .forward is world 
  663.     readable and your home directory world searchable in order for the
  664.     mail transport agent to "see" it.  To do this type:
  665.    
  666.       cd
  667.       chmod 644 .forward
  668.       chmod a+x .
  669.  
  670.  
  671. 6] Send yourself two test messages: one with ``test'' in the subject
  672.    and one without ``test'' in the subject.
  673.  
  674.  
  675. 7a] Start your mailer (pine, elm, etc.) and check that the messages
  676.     were delivered correctly.  The one with ``test'' in the subject
  677.     should be in the folder IN.testing and the one without ``test'' 
  678.     in the subject should be in your inbox.  If these were delivered 
  679.     correctly go on to step 8.
  680.  
  681.  
  682. 7b] TROUBLESHOOTING
  683.     * If the two messages were not delivered correctly look at your
  684.       ~/.elm/filter-errors to see if you can determine what the problem 
  685.       is.  
  686.  
  687.     * Check these two files for typos:
  688.         ~/.forward
  689.         ~/.elm/filter-rules
  690.  
  691.     * Check the file and directory permissions of your .forward (set in 
  692.       5c above).
  693.  
  694.       Type...          In order to...
  695.       -------          --------------
  696.       cd               Go to your home directory.
  697.       
  698.       ls -l .forward   Check the permission: it should say -rw-r--r--
  699.       
  700.       ls -ld .         Check permission of home dir: it should say drwx?-x?-x
  701.                        The ?'s may be r's or hyphens or one of each (i.e.,
  702.                        drwx--x--x, drwxr-xr-x, drwxr-x--x, drwx--xr-x).
  703.       
  704.  
  705.     * If none of these turn up the problem edit your ~/.forward so
  706.       that filter will be verbose with it's output (use the -vo flag).
  707.  
  708.         "|/usr/local/bin/filter -vo /j/nancym/.elm/filter-errors"
  709.  
  710.       And repeat steps 6 and 7.  After you get filter to work you 
  711.       will probably want to change the ``-vo'' flag back to ``-o''.
  712.  
  713.    
  714. 8]  After you have successfully tested filter in steps 6 and 7, edit
  715.     ~/.elm/filter-rules so that it contains a modified version of the
  716.     following:
  717.  
  718.      # if (subject contains "test") then save "/j/nancym/Mail/IN.testing"
  719.      if (to contains "www-talk") then save "/j/nancym/Mail/IN.www-talk"
  720.      if (to contains "hopos-l") then save "/j/nancym/Mail/IN.hopos"
  721.  
  722.      Replace /j/nancym with your home directory path and
  723.      /Mail with the name of your mail directory.  Replace the mailing 
  724.      list string (e.g., "www-talk") and the name of the mail folder
  725.      (e.g., IN.www-talk) with text for your mailing lists.
  726.  
  727.      Note that ``to contains...'' means either the To or Cc header contains...
  728.  
  729.      Rather than deleting the test line, it's useful to just turn it
  730.      into a comment (by preceding it with #) so that you can easily
  731.      use it for future testing.
  732.  
  733. ------------------------------
  734.  
  735. Date: 17 Nov 1994 23:03:20 GMT
  736. From: Nancy McGough <nancym@ii.com>
  737. Subject: ... 3.2 Tracking Your Incoming Mail
  738. Followup-To: comp.mail.elm
  739.  
  740. You can get a short summary of filter's activity by typing:
  741.  
  742.     filter -s
  743.  
  744. For a longer summary type:
  745.  
  746.     filter -S
  747.  
  748. Or you can look at the log file itself, ~/.elm/filterlog.
  749.  
  750. You should regularly look at ~/.elm/filter-errors to make sure things 
  751. are working.  You can automatically check filter-errors each time you
  752. log in by putting the following in your .login:
  753.  
  754.     tail ~/.elm/filter-errors
  755.  
  756. Also you probably want to regularly delete filterlog and filter-errors so 
  757. they don't fill up your disk space.  To get a summary of the filter log and 
  758. clear it type:
  759.  
  760.     filter -cs
  761.  
  762. ------------------------------
  763.  
  764. Date: 17 Nov 1994 23:03:30 GMT
  765. From: Nancy McGough <nancym@ii.com>
  766. Subject: ... 3.3 Filter References
  767. Followup-To: comp.mail.elm
  768.  
  769. Web Page:  http://www.myxa.com/elm.html
  770. FAQs:      http://www.cis.ohio-state.edu/hypertext/faq/usenet/elm/top.html
  771. Manual:    filter(1)
  772. Newsgroup: comp.mail.elm
  773.  
  774. ------------------------------
  775.  
  776. Date: 17 Nov 1994 23:04:00 GMT
  777. From: Nancy McGough <nancym@ii.com>
  778. Subject: 4.0 Reading Incoming Mail Folders
  779.  
  780. To read an incoming mail folder use your mailer or newsreader (if it
  781. can read mail folders).  For more information see documentation for your 
  782. mailer or newsreader.  Here are some pointers.
  783.  
  784. PINE
  785. ====
  786. FAQ:       http://www.cac.washington.edu/pine/faq/
  787.            ftp://ftp.cac.washington.edu/pine/docs/faq
  788. Manual:    pine(1)
  789. Newsgroup: comp.mail.pine (linked to Pine mailing list)
  790. Mailing List: pine-info@cac.washington.edu (linked to Pine newsgroup)
  791.            Subscribe to the pine-info mailing list by sending mail to:
  792.                      majordomo@cac.washington.edu
  793.            With...
  794.                      subscribe pine-info
  795.            in the body of the message.
  796.  
  797.  
  798. ELM
  799. ===
  800. Web Page:  http://www.myxa.com/elm.html
  801. FAQs:      http://www.cis.ohio-state.edu/hypertext/faq/usenet/elm/top.html
  802. Manual:    elm(1)
  803. Newsgroup: comp.mail.elm
  804.  
  805.  
  806. Emacs Mail Mode
  807. ===============
  808. Newsgroups: gnus.emacs.help and comp.emacs
  809. http://www.cis.ohio-state.edu/hypertext/faq/usenet/GNU-Emacs-FAQ/part5/faq.html    
  810.  
  811. MH
  812. ==
  813. FAQ:       http://www.cis.ohio-state.edu/hypertext/faq/usenet/mh-faq/top.html
  814. Manual:    mh(1)
  815. Newsgroup: comp.mail.mh
  816.  
  817.  
  818. MAIL
  819. ====
  820. Manual:    mail(1)
  821. Newsgroup: comp.mail.misc
  822.  
  823.  
  824. NN
  825. ==
  826. FAQ:       http://www.cis.ohio-state.edu/hypertext/faq/usenet/nn-faq/top.html
  827. Manual:    nn(1)
  828. Newsgroup: news.software.nn
  829.  
  830. (Does anyone know if nn uses lock files?  Is there any problem using nn
  831. to read a mail folder that is receiving mail?  Please let me know!)
  832.  
  833. (Also, please let me know what other newsreaders can read mail folders?)
  834.  
  835. ------------------------------
  836.  
  837. Date: 17 Nov 1994 23:05:00 GMT
  838. From: Nancy McGough <nancym@ii.com>
  839. Subject: 5.0 Contributing to this FAQ
  840.  
  841. If you have any corrections, suggestions, or new digest items to contribute
  842. to this FAQ please send them to me at nancym@ii.com.  If you are reading this
  843. with a viewer that understands the following URL you can use it to send me 
  844. mail:   mailto:nancym@ii.com
  845.  
  846. Between official releases of this FAQ the plain text (ascii) version of
  847. the most up to date version of it is at:
  848.  
  849.    ftp://ftp.halcyon.com/pub/ii/Internet/filtering_mail_faq
  850.  
  851.  
  852. End of Filtering Mail Digest
  853. ****************************
  854.  
  855. -- 
  856.  /\_/\
  857. ( o.o )   Nancy McGough       http://www.jazzie.com/ii/
  858.  > ^ <    Infinite Ink        ftp://ftp.halcyon.com/pub/ii
  859.